<template>
	<view>
		<u-grid :col="3">
			<u-grid-item>
				<view>
					<text>{{firedata[0].sensorName}}</text>
				</view>
				<view>
					<u-icon></u-icon>
					<text>{{firedata[0].vals}}</text>
					<text>{{firedata[0].unit}}</text>
				</view>
			</u-grid-item>
			<u-grid-item>
				<view>
					<text>{{firedata[1].sensorName}}</text>
				</view>
				<view>
					<u-icon></u-icon>
					<text>{{firedata[1].vals}}</text>
					<text>{{firedata[1].unit}}</text>
				</view>
			</u-grid-item>
			<u-grid-item>
				<view>
					<text>{{firedata[2].sensorName}}</text>
				</view>
				<view>
					<u-icon></u-icon>
					<text>{{firedata[2].vals}}</text>
					<text>{{firedata[2].unit}}</text>
				</view>
			</u-grid-item>
			
			<u-grid-item>
				<view>
					<text>{{firedata[3].sensorName}}</text>
				</view>
				<view>
					<u-icon></u-icon>
					<text>{{firedata[3].vals}}</text>
					<text>{{firedata[3].unit}}</text>
				</view>
			</u-grid-item>
			
			<u-grid-item>
				<view>
					<text>{{firedata[4].sensorName}}</text>
				</view>
				<view>
					<u-icon></u-icon>
					<text>{{firedata[4].vals}}</text>
					<text>{{firedata[4].unit}}</text>
				</view>
			</u-grid-item>
			
			<u-grid-item>
				<view>
					<text>{{firedata[5].sensorName}}</text>
				</view>
				<view>
					<u-icon></u-icon>
					<text>{{firedata[5].vals}}</text>
					<text>{{firedata[5].unit}}</text>
				</view>
			</u-grid-item>
			
		</u-grid>
	</view>
</template>

<script>
	export default {
		
		data() {
			return {
				firedata:[
				    {
				      "unit": "m/s",
				      "deviceId": "4028fa81758d2e0c01758d2ff2830000",
				      "sensorName": "风速",
				      "nodeId": "1",
				      "recordTime": "2020-12-31T10:08:54.499+00:00",
				      "vals": 0
				    },
				    {
				      "unit": "级",
				      "deviceId": "4028fa81758d2e0c01758d2ff2830000",
				      "sensorName": "风力",
				      "nodeId": "1",
				      "recordTime": "2020-12-31T10:08:54.499+00:00",
				      "vals": 0
				    },
				    {
				      "unit": "°C",
				      "deviceId": "4028fa81758d2e0c01758d2ff2830000",
				      "sensorName": "温度",
				      "nodeId": "3",
				      "recordTime": "2020-12-31T10:08:54.499+00:00",
				      "vals": -4.3
				    },
				    {
				      "unit": "°C",
				      "deviceId": "4028fa81758d2e0c01758d2ff2830000",
				      "sensorName": "湿度",
				      "nodeId": "3",
				      "recordTime": "2020-12-31T10:08:54.499+00:00",
				      "vals": 69.4
				    },
				    {
				      "unit": "Kpa",
				      "deviceId": "4028fa81758d2e0c01758d2ff2830000",
				      "sensorName": "大气",
				      "nodeId": "4",
				      "recordTime": "2020-12-31T10:08:54.499+00:00",
				      "vals": 68.7
				    },
				    {
				      "unit": "Lux",
				      "deviceId": "4028fa81758d2e0c01758d2ff2830000",
				      "sensorName": "光照",
				      "nodeId": "5",
				      "recordTime": "2020-12-31T10:08:54.499+00:00",
				      "vals": 1161
				    }
				  ]
			}
		},
		methods: {

		},
		mounted() {
			uni.request({
							url: this.$url + '/mobile/weater/get_current',
							method: 'POST',
							success: (res) => {
								let data = res.data.data;
								if (data != undefined) {
									this.firedata = data
									console.log("气象站信息", this.firedata)
								} else {
									console.log("未能气象站信息")
								}
							}
						})
		}

	}
</script>

<style lang="scss" scoped>
	

</style>
